/*****************************************************************************
 * Copyright (C) Stacy Curl. All rights reserved.                            *
 * ------------------------------------------------------------------------- *
 * The software in this package is published under the terms of the BSD      *
 * style license a copy of which has been included with this distribution in *
 * the LICENSE.txt file.                                                     *
 *****************************************************************************/
package conversation;

import example.model.Database;
import picounit.Test;
import picounit.Verify;

public class VerifyExample implements Test {
	private final Database database;

	public VerifyExample(Database database) {
		this.database = database;
	}

	public void insertingAPersonShouldIncreaseTheNumberOfPeopleInTheDatabase(Verify verify) {
		int previousNumberOfPeople = numberOfPeopleInTheDatabase();

		database.insert("insert into people (name) values('Fred Dibner')");

		verify.that(numberOfPeopleInTheDatabase())
			.isGreaterThan(previousNumberOfPeople)
			.because("Should be one more person in the database");
	}
	
	private int numberOfPeopleInTheDatabase() {
		return 1;//database.queryCount("select count(*) from PEOPLE");
	}
}
